package com.jiazhong.ssm.test04异常.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Auther:shuXin
 */
@RestController
@RequestMapping("excp")
public class ExceptionController {

    @GetMapping("data")
    public Object data() {
        String name = null;
        System.out.println("空指针异常");
        name.toString();
        return "ok";
    }

    @GetMapping("data1")
    public Object data1() {
        System.out.println("空指针异常");
        System.out.println(1 / 0);
        return "ok";
    }
}
